package com.scu.controller;

import com.scu.pojo.Report;
import com.scu.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;

@Controller

public class ReportController {
    @Autowired
    private ReportService reportService;

    @RequestMapping("getReportList")
    @ResponseBody
    public HashMap getReportList() {
        List<Report> reports = reportService.getReportList();
        HashMap<String,Object> map = new HashMap<>();
        map.put("code", 200);
        map.put("msg", "");
        map.put("data", reports);

        return map;
    }
}
